package com.test.messagewall.mapper;

import com.test.messagewall.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper {
    // 1.发表留言功能，即插入操作
    @Insert("insert into message_info (`from`,`to`,`message`) values (#{from},#{to},#{message})")
    Integer insertMessage(MessageInfo messageInfo);

    // 2.获取留言，查询操作
    @Select("select * from message_info")
    List<MessageInfo> selectAllMessage();
}
